home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7968 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.iosphere.net!ianq
  2. From: ianq@sonetis.com (Ian V. Quickmire)
  3. Newsgroups: comp.lang.c
  4. Subject: Memory Allocation and Pointer
  5. Date: Thu, 29 Feb 96 20:56:16 GMT
  6. Organization: IQ Systems Ltd.
  7. Distribution: inet
  8. Message-ID: <4h53tg$3q0_001@rmoc.on.ca>
  9. NNTP-Posting-Host: port005-24-yow.iosphere.net
  10. X-Newsreader: News Xpress Version 1.0 Beta #3
  11.  
  12. I am using a proprietary Windows32 RAD application to allocate memory so that 
  13. when an ODBC DLL I am writing is called, the DLL can read the resultant 
  14. string in said memory location.
  15.  
  16. Problem I am having is seeing what is in the memory location. Probably my 
  17. fault in dealing with pointers, hopefully someone can kick start me so that I 
  18. see my error.
  19.  
  20. The application allocates a piece of memory, casting it as a character string 
  21. 60 bytes long.
  22.  
  23. It then sends the address of said memory to my DLL as a pointer to int, at 
  24. least according to the app's H file.
  25.  
  26. The definition in the app's H file for the function used to send the address 
  27. is:
  28.  
  29. fnsend(int *pValue)
  30.  
  31. My DLL defines an int rValue, and then receives the passed parm as:
  32.  
  33. fnsend(&rValue)
  34.  
  35. The resultant rValue = the address sent in pValue.
  36.  
  37. The problem I see is that I am receiving the address as a value, not as an 
  38. address to memory where a string is stored.
  39.  
  40. What need I define in my DLL to receive the address as an address so that I 
  41. may retrieve the string stored in memory at stated address? All I have 
  42. figured out is how to retrieve the address, not the data at the address.
  43.  
  44. Okay, shoot me then!
  45.  
  46. --------------------------------------------------------------
  47. Work: izq00@ccc.amdahl.com              Home: ianq@sonetis.com
  48. WWW: http://www.sonetis.com/~ianq/      CIS: 74032,573
  49. --------------------------------------------------------------
  50.